home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / EPISODE / JKM_PCG.GOO / cog_s1l3_cameragenerator.cog < prev    next >
Text File  |  1998-02-25  |  962b  |  34 lines

  1. # S1L3_CameraGenerator.cog
  2. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  3.  
  4. symbols
  5. thing            generator_pos    desc=generator_ghost
  6. template        enemy_tpl        desc=enemy_to_generate
  7. int            enemy            local
  8. int            enemycreated=0    local
  9. int            CameraNumber=1
  10. int            UseThisNumber    local
  11. message        startup
  12. message        trigger
  13. end
  14.  
  15. code
  16. startup:
  17.     if(CameraNumber<1) CameraNumber=0;
  18.     if(CameraNumber>11) CameraNumber=0;
  19.     if(CameraNumber==0) return;
  20.     UseThisNumber=(10000+CameraNumber);        
  21.     if (generator_pos==-1) return;    //dumps out if generator_pos doesn't appear
  22.     return;
  23. trigger:
  24.     if(GetSourceRef()!=UseThisNumber) return;    //looks for the camera's trigger reference
  25.     if(enemycreated==1) return;               //dumps out if the enemy has already been created
  26.     if(!HasLOS(player, generator_pos))        //creates enemy if player can't see generator_pos
  27.     {
  28.         enemy = CreateThing(enemy_tpl,generator_pos);
  29.         enemycreated=1;
  30.         CaptureThing(enemy);
  31.     }
  32.     return;
  33. end
  34.